package cn.ibizlab.odoo.core.odoo_event.service.impl;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.math.BigInteger;
import java.util.Collection;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import cn.ibizlab.odoo.core.client.model.Ievent_event;
import cn.ibizlab.odoo.core.odoo_event.domain.Event_event;
import cn.ibizlab.odoo.core.odoo_event.filter.Event_eventSearchContext;
import cn.ibizlab.odoo.core.odoo_event.service.IEvent_eventService;
import cn.ibizlab.odoo.util.SearchResult;
import cn.ibizlab.odoo.util.log.IBIZLog;

/**
 * 实体[活动] 服务对象接口实现
 */
@Slf4j
@IBIZLog
@Service
public class Event_eventServiceImpl implements IEvent_eventService {

    @Autowired
    private cn.ibizlab.odoo.core.client.service.Ievent_eventClientService event_eventClientService;

    @Override
    public Event_event get(Integer id) {
        Ievent_event clientModel = event_eventClientService.createModel();
        clientModel.setId(id);
        event_eventClientService.get(clientModel) ;
        return this.convert2Domain(clientModel,null);
    }

    @Override
    public Event_event get(Event_event event_event) {
        Event_event retevent_event = this.get(event_event.getId()) ;
    	BeanCopier copier=BeanCopier.create(retevent_event.getClass(), event_event.getClass(), false);
        copier.copy(retevent_event, event_event, null);
        return event_event ;
    }

    @Override
    public boolean create(Event_event event_event) {
        boolean bOk = false ;
        Ievent_event clientModel = this.convert2Model(event_event,null);
        event_eventClientService.create(clientModel) ;
        this.convert2Domain(clientModel,event_event);
        bOk = true ;

        return bOk ;
    }

    @Override
    public void removeBatch(Collection<? extends Serializable> idList, int batchSize) {

        //event_eventClientService.removeBatch(event_events) ;

    }

    @Override
    public boolean update(Event_event event_event) {
        boolean bOk = false ;
        Ievent_event clientModel = this.convert2Model(event_event,null);
        event_eventClientService.update(clientModel) ;
        this.convert2Domain(clientModel,event_event) ;
        bOk = true;
        return bOk ;
    }

    @Override
    public void createBatch(List<Event_event> event_events, int batchSize) {

                        //event_eventClientService.createBatch(event_events,batchSize) ;

    }

    @Override
    public void updateBatch(List<Event_event> event_events, int batchSize) {

        //event_eventClientService.updateBatch(event_events,batchSize) ;

    }

    @Override
    public boolean remove(Integer id) {
        boolean bOk = false ;
        Ievent_event clientModel = event_eventClientService.createModel();
        clientModel.setId(id);
        event_eventClientService.remove(clientModel) ;
        bOk = true ;
        return bOk ;
    }

    /**
     * 查询集合 默认查询
     */
    @Override
    public Page<Event_event> searchDefault(Event_eventSearchContext context) {
        List<Event_event> list = new ArrayList<Event_event>();
        Page<cn.ibizlab.odoo.core.client.model.Ievent_event> clientModelList = event_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ievent_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Event_event>(list, context.getPageable(), clientModelList.getTotalElements());
    }


    /**
     * 根据活动类别查询
     */
    @Override
    public Page<Event_event> selectByOdoo_event_type(Integer id){
        Event_eventSearchContext context = new Event_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Event_event> list = new ArrayList<Event_event>();
        Page<cn.ibizlab.odoo.core.client.model.Ievent_event> clientModelList = event_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ievent_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Event_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据公司查询
     */
    @Override
    public Page<Event_event> selectByOdoo_company(Integer id){
        Event_eventSearchContext context = new Event_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Event_event> list = new ArrayList<Event_event>();
        Page<cn.ibizlab.odoo.core.client.model.Ievent_event> clientModelList = event_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ievent_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Event_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据国家/地区查询
     */
    @Override
    public Page<Event_event> selectByOdoo_country(Integer id){
        Event_eventSearchContext context = new Event_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Event_event> list = new ArrayList<Event_event>();
        Page<cn.ibizlab.odoo.core.client.model.Ievent_event> clientModelList = event_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ievent_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Event_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据联系人查询
     */
    @Override
    public Page<Event_event> selectByOdoo_address(Integer id){
        Event_eventSearchContext context = new Event_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Event_event> list = new ArrayList<Event_event>();
        Page<cn.ibizlab.odoo.core.client.model.Ievent_event> clientModelList = event_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ievent_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Event_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据联系人查询
     */
    @Override
    public Page<Event_event> selectByOdoo_organizer(Integer id){
        Event_eventSearchContext context = new Event_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Event_event> list = new ArrayList<Event_event>();
        Page<cn.ibizlab.odoo.core.client.model.Ievent_event> clientModelList = event_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ievent_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Event_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Event_event> selectByOdoo_create(Integer id){
        Event_eventSearchContext context = new Event_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Event_event> list = new ArrayList<Event_event>();
        Page<cn.ibizlab.odoo.core.client.model.Ievent_event> clientModelList = event_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ievent_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Event_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Event_event> selectByOdoo_user(Integer id){
        Event_eventSearchContext context = new Event_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Event_event> list = new ArrayList<Event_event>();
        Page<cn.ibizlab.odoo.core.client.model.Ievent_event> clientModelList = event_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ievent_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Event_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Event_event> selectByOdoo_write(Integer id){
        Event_eventSearchContext context = new Event_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Event_event> list = new ArrayList<Event_event>();
        Page<cn.ibizlab.odoo.core.client.model.Ievent_event> clientModelList = event_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ievent_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Event_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据网站菜单查询
     */
    @Override
    public Page<Event_event> selectByOdoo_menu(Integer id){
        Event_eventSearchContext context = new Event_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Event_event> list = new ArrayList<Event_event>();
        Page<cn.ibizlab.odoo.core.client.model.Ievent_event> clientModelList = event_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ievent_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Event_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }



    public Ievent_event convert2Model(Event_event domain , Ievent_event model) {
        if(domain == null)
            return model ;
        if(model==null){
            model = event_eventClientService.createModel() ;
        }

         if(domain.getSeats_usedDirtyFlag())
            model.setSeats_used(domain.getSeats_used());
         if(domain.getIs_seo_optimizedDirtyFlag())
            model.setIs_seo_optimized(domain.getIs_seo_optimized());
         if(domain.getIdDirtyFlag())
            model.setId(domain.getId());
         if(domain.getBadge_frontDirtyFlag())
            model.setBadge_front(domain.getBadge_front());
         if(domain.getStateDirtyFlag())
            model.setState(domain.getState());
         if(domain.getEvent_mail_idsDirtyFlag())
            model.setEvent_mail_ids(domain.getEvent_mail_ids());
         if(domain.getCreate_dateDirtyFlag())
            model.setCreate_date(domain.getCreate_date());
         if(domain.getSeats_expectedDirtyFlag())
            model.setSeats_expected(domain.getSeats_expected());
         if(domain.getMessage_unreadDirtyFlag())
            model.setMessage_unread(domain.getMessage_unread());
         if(domain.getMessage_needactionDirtyFlag())
            model.setMessage_needaction(domain.getMessage_needaction());
         if(domain.getSeats_availabilityDirtyFlag())
            model.setSeats_availability(domain.getSeats_availability());
         if(domain.getEvent_ticket_idsDirtyFlag())
            model.setEvent_ticket_ids(domain.getEvent_ticket_ids());
         if(domain.getSeats_unconfirmedDirtyFlag())
            model.setSeats_unconfirmed(domain.getSeats_unconfirmed());
         if(domain.getIs_participatingDirtyFlag())
            model.setIs_participating(domain.getIs_participating());
         if(domain.getMessage_channel_idsDirtyFlag())
            model.setMessage_channel_ids(domain.getMessage_channel_ids());
         if(domain.getTwitter_hashtagDirtyFlag())
            model.setTwitter_hashtag(domain.getTwitter_hashtag());
         if(domain.getSeats_maxDirtyFlag())
            model.setSeats_max(domain.getSeats_max());
         if(domain.getDate_beginDirtyFlag())
            model.setDate_begin(domain.getDate_begin());
         if(domain.getMessage_main_attachment_idDirtyFlag())
            model.setMessage_main_attachment_id(domain.getMessage_main_attachment_id());
         if(domain.getWebsite_meta_og_imgDirtyFlag())
            model.setWebsite_meta_og_img(domain.getWebsite_meta_og_img());
         if(domain.getWebsite_publishedDirtyFlag())
            model.setWebsite_published(domain.getWebsite_published());
         if(domain.getMessage_idsDirtyFlag())
            model.setMessage_ids(domain.getMessage_ids());
         if(domain.getWebsite_meta_titleDirtyFlag())
            model.setWebsite_meta_title(domain.getWebsite_meta_title());
         if(domain.getMessage_has_error_counterDirtyFlag())
            model.setMessage_has_error_counter(domain.getMessage_has_error_counter());
         if(domain.getRegistration_idsDirtyFlag())
            model.setRegistration_ids(domain.getRegistration_ids());
         if(domain.getDescriptionDirtyFlag())
            model.setDescription(domain.getDescription());
         if(domain.getBadge_innerrightDirtyFlag())
            model.setBadge_innerright(domain.getBadge_innerright());
         if(domain.getMessage_is_followerDirtyFlag())
            model.setMessage_is_follower(domain.getMessage_is_follower());
         if(domain.getWebsite_meta_descriptionDirtyFlag())
            model.setWebsite_meta_description(domain.getWebsite_meta_description());
         if(domain.getSeats_minDirtyFlag())
            model.setSeats_min(domain.getSeats_min());
         if(domain.getMessage_follower_idsDirtyFlag())
            model.setMessage_follower_ids(domain.getMessage_follower_ids());
         if(domain.getBadge_backDirtyFlag())
            model.setBadge_back(domain.getBadge_back());
         if(domain.getWebsite_meta_keywordsDirtyFlag())
            model.setWebsite_meta_keywords(domain.getWebsite_meta_keywords());
         if(domain.getMessage_unread_counterDirtyFlag())
            model.setMessage_unread_counter(domain.getMessage_unread_counter());
         if(domain.getAuto_confirmDirtyFlag())
            model.setAuto_confirm(domain.getAuto_confirm());
         if(domain.getDate_endDirtyFlag())
            model.setDate_end(domain.getDate_end());
         if(domain.getNameDirtyFlag())
            model.setName(domain.getName());
         if(domain.getBadge_innerleftDirtyFlag())
            model.setBadge_innerleft(domain.getBadge_innerleft());
         if(domain.getSeats_reservedDirtyFlag())
            model.setSeats_reserved(domain.getSeats_reserved());
         if(domain.getWebsite_menuDirtyFlag())
            model.setWebsite_menu(domain.getWebsite_menu());
         if(domain.getMessage_attachment_countDirtyFlag())
            model.setMessage_attachment_count(domain.getMessage_attachment_count());
         if(domain.getWebsite_idDirtyFlag())
            model.setWebsite_id(domain.getWebsite_id());
         if(domain.getActiveDirtyFlag())
            model.setActive(domain.getActive());
         if(domain.getDate_end_locatedDirtyFlag())
            model.setDate_end_located(domain.getDate_end_located());
         if(domain.getSeats_availableDirtyFlag())
            model.setSeats_available(domain.getSeats_available());
         if(domain.getIs_publishedDirtyFlag())
            model.setIs_published(domain.getIs_published());
         if(domain.getMessage_partner_idsDirtyFlag())
            model.setMessage_partner_ids(domain.getMessage_partner_ids());
         if(domain.getIs_onlineDirtyFlag())
            model.setIs_online(domain.getIs_online());
         if(domain.getDate_tzDirtyFlag())
            model.setDate_tz(domain.getDate_tz());
         if(domain.getDisplay_nameDirtyFlag())
            model.setDisplay_name(domain.getDisplay_name());
         if(domain.getMessage_has_errorDirtyFlag())
            model.setMessage_has_error(domain.getMessage_has_error());
         if(domain.get__last_updateDirtyFlag())
            model.set__last_update(domain.get__last_update());
         if(domain.getMessage_needaction_counterDirtyFlag())
            model.setMessage_needaction_counter(domain.getMessage_needaction_counter());
         if(domain.getWrite_dateDirtyFlag())
            model.setWrite_date(domain.getWrite_date());
         if(domain.getWebsite_message_idsDirtyFlag())
            model.setWebsite_message_ids(domain.getWebsite_message_ids());
         if(domain.getDate_begin_locatedDirtyFlag())
            model.setDate_begin_located(domain.getDate_begin_located());
         if(domain.getEvent_logoDirtyFlag())
            model.setEvent_logo(domain.getEvent_logo());
         if(domain.getWebsite_urlDirtyFlag())
            model.setWebsite_url(domain.getWebsite_url());
         if(domain.getColorDirtyFlag())
            model.setColor(domain.getColor());
         if(domain.getWrite_uid_textDirtyFlag())
            model.setWrite_uid_text(domain.getWrite_uid_text());
         if(domain.getEvent_type_id_textDirtyFlag())
            model.setEvent_type_id_text(domain.getEvent_type_id_text());
         if(domain.getCreate_uid_textDirtyFlag())
            model.setCreate_uid_text(domain.getCreate_uid_text());
         if(domain.getAddress_id_textDirtyFlag())
            model.setAddress_id_text(domain.getAddress_id_text());
         if(domain.getCountry_id_textDirtyFlag())
            model.setCountry_id_text(domain.getCountry_id_text());
         if(domain.getMenu_id_textDirtyFlag())
            model.setMenu_id_text(domain.getMenu_id_text());
         if(domain.getCompany_id_textDirtyFlag())
            model.setCompany_id_text(domain.getCompany_id_text());
         if(domain.getUser_id_textDirtyFlag())
            model.setUser_id_text(domain.getUser_id_text());
         if(domain.getOrganizer_id_textDirtyFlag())
            model.setOrganizer_id_text(domain.getOrganizer_id_text());
         if(domain.getUser_idDirtyFlag())
            model.setUser_id(domain.getUser_id());
         if(domain.getCountry_idDirtyFlag())
            model.setCountry_id(domain.getCountry_id());
         if(domain.getCompany_idDirtyFlag())
            model.setCompany_id(domain.getCompany_id());
         if(domain.getOrganizer_idDirtyFlag())
            model.setOrganizer_id(domain.getOrganizer_id());
         if(domain.getMenu_idDirtyFlag())
            model.setMenu_id(domain.getMenu_id());
         if(domain.getCreate_uidDirtyFlag())
            model.setCreate_uid(domain.getCreate_uid());
         if(domain.getAddress_idDirtyFlag())
            model.setAddress_id(domain.getAddress_id());
         if(domain.getWrite_uidDirtyFlag())
            model.setWrite_uid(domain.getWrite_uid());
         if(domain.getEvent_type_idDirtyFlag())
            model.setEvent_type_id(domain.getEvent_type_id());
        return model ;
    }

    public Event_event convert2Domain( Ievent_event model ,Event_event domain) {
        if(model == null)
            return domain ;
        if(domain == null){
            domain = new Event_event();
        }

        if(model.getSeats_usedDirtyFlag())
            domain.setSeats_used(model.getSeats_used());
        if(model.getIs_seo_optimizedDirtyFlag())
            domain.setIs_seo_optimized(model.getIs_seo_optimized());
        if(model.getIdDirtyFlag())
            domain.setId(model.getId());
        if(model.getBadge_frontDirtyFlag())
            domain.setBadge_front(model.getBadge_front());
        if(model.getStateDirtyFlag())
            domain.setState(model.getState());
        if(model.getEvent_mail_idsDirtyFlag())
            domain.setEvent_mail_ids(model.getEvent_mail_ids());
        if(model.getCreate_dateDirtyFlag())
            domain.setCreate_date(model.getCreate_date());
        if(model.getSeats_expectedDirtyFlag())
            domain.setSeats_expected(model.getSeats_expected());
        if(model.getMessage_unreadDirtyFlag())
            domain.setMessage_unread(model.getMessage_unread());
        if(model.getMessage_needactionDirtyFlag())
            domain.setMessage_needaction(model.getMessage_needaction());
        if(model.getSeats_availabilityDirtyFlag())
            domain.setSeats_availability(model.getSeats_availability());
        if(model.getEvent_ticket_idsDirtyFlag())
            domain.setEvent_ticket_ids(model.getEvent_ticket_ids());
        if(model.getSeats_unconfirmedDirtyFlag())
            domain.setSeats_unconfirmed(model.getSeats_unconfirmed());
        if(model.getIs_participatingDirtyFlag())
            domain.setIs_participating(model.getIs_participating());
        if(model.getMessage_channel_idsDirtyFlag())
            domain.setMessage_channel_ids(model.getMessage_channel_ids());
        if(model.getTwitter_hashtagDirtyFlag())
            domain.setTwitter_hashtag(model.getTwitter_hashtag());
        if(model.getSeats_maxDirtyFlag())
            domain.setSeats_max(model.getSeats_max());
        if(model.getDate_beginDirtyFlag())
            domain.setDate_begin(model.getDate_begin());
        if(model.getMessage_main_attachment_idDirtyFlag())
            domain.setMessage_main_attachment_id(model.getMessage_main_attachment_id());
        if(model.getWebsite_meta_og_imgDirtyFlag())
            domain.setWebsite_meta_og_img(model.getWebsite_meta_og_img());
        if(model.getWebsite_publishedDirtyFlag())
            domain.setWebsite_published(model.getWebsite_published());
        if(model.getMessage_idsDirtyFlag())
            domain.setMessage_ids(model.getMessage_ids());
        if(model.getWebsite_meta_titleDirtyFlag())
            domain.setWebsite_meta_title(model.getWebsite_meta_title());
        if(model.getMessage_has_error_counterDirtyFlag())
            domain.setMessage_has_error_counter(model.getMessage_has_error_counter());
        if(model.getRegistration_idsDirtyFlag())
            domain.setRegistration_ids(model.getRegistration_ids());
        if(model.getDescriptionDirtyFlag())
            domain.setDescription(model.getDescription());
        if(model.getBadge_innerrightDirtyFlag())
            domain.setBadge_innerright(model.getBadge_innerright());
        if(model.getMessage_is_followerDirtyFlag())
            domain.setMessage_is_follower(model.getMessage_is_follower());
        if(model.getWebsite_meta_descriptionDirtyFlag())
            domain.setWebsite_meta_description(model.getWebsite_meta_description());
        if(model.getSeats_minDirtyFlag())
            domain.setSeats_min(model.getSeats_min());
        if(model.getMessage_follower_idsDirtyFlag())
            domain.setMessage_follower_ids(model.getMessage_follower_ids());
        if(model.getBadge_backDirtyFlag())
            domain.setBadge_back(model.getBadge_back());
        if(model.getWebsite_meta_keywordsDirtyFlag())
            domain.setWebsite_meta_keywords(model.getWebsite_meta_keywords());
        if(model.getMessage_unread_counterDirtyFlag())
            domain.setMessage_unread_counter(model.getMessage_unread_counter());
        if(model.getAuto_confirmDirtyFlag())
            domain.setAuto_confirm(model.getAuto_confirm());
        if(model.getDate_endDirtyFlag())
            domain.setDate_end(model.getDate_end());
        if(model.getNameDirtyFlag())
            domain.setName(model.getName());
        if(model.getBadge_innerleftDirtyFlag())
            domain.setBadge_innerleft(model.getBadge_innerleft());
        if(model.getSeats_reservedDirtyFlag())
            domain.setSeats_reserved(model.getSeats_reserved());
        if(model.getWebsite_menuDirtyFlag())
            domain.setWebsite_menu(model.getWebsite_menu());
        if(model.getMessage_attachment_countDirtyFlag())
            domain.setMessage_attachment_count(model.getMessage_attachment_count());
        if(model.getWebsite_idDirtyFlag())
            domain.setWebsite_id(model.getWebsite_id());
        if(model.getActiveDirtyFlag())
            domain.setActive(model.getActive());
        if(model.getDate_end_locatedDirtyFlag())
            domain.setDate_end_located(model.getDate_end_located());
        if(model.getSeats_availableDirtyFlag())
            domain.setSeats_available(model.getSeats_available());
        if(model.getIs_publishedDirtyFlag())
            domain.setIs_published(model.getIs_published());
        if(model.getMessage_partner_idsDirtyFlag())
            domain.setMessage_partner_ids(model.getMessage_partner_ids());
        if(model.getIs_onlineDirtyFlag())
            domain.setIs_online(model.getIs_online());
        if(model.getDate_tzDirtyFlag())
            domain.setDate_tz(model.getDate_tz());
        if(model.getDisplay_nameDirtyFlag())
            domain.setDisplay_name(model.getDisplay_name());
        if(model.getMessage_has_errorDirtyFlag())
            domain.setMessage_has_error(model.getMessage_has_error());
        if(model.get__last_updateDirtyFlag())
            domain.set__last_update(model.get__last_update());
        if(model.getMessage_needaction_counterDirtyFlag())
            domain.setMessage_needaction_counter(model.getMessage_needaction_counter());
        if(model.getWrite_dateDirtyFlag())
            domain.setWrite_date(model.getWrite_date());
        if(model.getWebsite_message_idsDirtyFlag())
            domain.setWebsite_message_ids(model.getWebsite_message_ids());
        if(model.getDate_begin_locatedDirtyFlag())
            domain.setDate_begin_located(model.getDate_begin_located());
        if(model.getEvent_logoDirtyFlag())
            domain.setEvent_logo(model.getEvent_logo());
        if(model.getWebsite_urlDirtyFlag())
            domain.setWebsite_url(model.getWebsite_url());
        if(model.getColorDirtyFlag())
            domain.setColor(model.getColor());
        if(model.getWrite_uid_textDirtyFlag())
            domain.setWrite_uid_text(model.getWrite_uid_text());
        if(model.getEvent_type_id_textDirtyFlag())
            domain.setEvent_type_id_text(model.getEvent_type_id_text());
        if(model.getCreate_uid_textDirtyFlag())
            domain.setCreate_uid_text(model.getCreate_uid_text());
        if(model.getAddress_id_textDirtyFlag())
            domain.setAddress_id_text(model.getAddress_id_text());
        if(model.getCountry_id_textDirtyFlag())
            domain.setCountry_id_text(model.getCountry_id_text());
        if(model.getMenu_id_textDirtyFlag())
            domain.setMenu_id_text(model.getMenu_id_text());
        if(model.getCompany_id_textDirtyFlag())
            domain.setCompany_id_text(model.getCompany_id_text());
        if(model.getUser_id_textDirtyFlag())
            domain.setUser_id_text(model.getUser_id_text());
        if(model.getOrganizer_id_textDirtyFlag())
            domain.setOrganizer_id_text(model.getOrganizer_id_text());
        if(model.getUser_idDirtyFlag())
            domain.setUser_id(model.getUser_id());
        if(model.getCountry_idDirtyFlag())
            domain.setCountry_id(model.getCountry_id());
        if(model.getCompany_idDirtyFlag())
            domain.setCompany_id(model.getCompany_id());
        if(model.getOrganizer_idDirtyFlag())
            domain.setOrganizer_id(model.getOrganizer_id());
        if(model.getMenu_idDirtyFlag())
            domain.setMenu_id(model.getMenu_id());
        if(model.getCreate_uidDirtyFlag())
            domain.setCreate_uid(model.getCreate_uid());
        if(model.getAddress_idDirtyFlag())
            domain.setAddress_id(model.getAddress_id());
        if(model.getWrite_uidDirtyFlag())
            domain.setWrite_uid(model.getWrite_uid());
        if(model.getEvent_type_idDirtyFlag())
            domain.setEvent_type_id(model.getEvent_type_id());
        return domain ;
    }


}
